<template>
	<view>
		<uni-popup ref="popup" type="bottom" :safe-area="false">
			<view class="popupWrap A-Medium" :class="model=='light'?'popupWrapLight':''">
				<view class="titleWrap py-4 mx-3 flex align-center justify-between">
					<view class="f0 opacity0">
						<image src="@/static/images/cha.png" mode=""></image>
					</view>
					<view class="">
						{{i18n['c00'+type]}}
					</view>
					<view @click="closePopup" class="f0">
						<image src="@/static/images/cha.png" mode=""></image>
					</view>
				</view>
				<view @click="confirm(item)" v-if="item.title!='USDT'||isShowUSDT===true" v-for="(item,index) in list" class="list mx-3 py-3" :class="model=='light'?'listLight':''">
					
					<image style="height: 72rpx;" :src="'/static/images/cz/cz'+item.id+'_'+model+'.png'" mode="heightFix"></image>
					<!-- <image style="height: 72rpx;" :src="'/static/images/cz/cz'+item.id+'_'+model+'.png'" mode="heightFix"></image> -->
				</view>
				<view class="" style="height: 68rpx;">
		
				</view>
			</view>
		</uni-popup>
	</view>
	
</template>

<script>
	import {
		getCoinTypeList
	} from '@/core/api/index.js';
	export default {
		name:"czPoup",
		props:{
			type:{
				type:Number,
				default:0
			},
			isShowUSDT:{
				type:Boolean,
				default:true,
			}
		},
		created() {
			getCoinTypeList({}).then(res=>{
				let list = res.result;
				for(let i=0;i<list.length;i++){
					if(list[i].title=='USDT'){
						list[i].id = 1;
					}
					if(list[i].title=='BTC'){
						list[i].id = 2;
					}
					if(list[i].title=='ETH'){
						list[i].id = 3;
					}
				}
				this.list = list;
			})
		},
		data() {
			return {
				list:[
					{
						id:1,
						title:'USDT',
					},
					{
						id:2,
						title:'BTC',
					},
					{
						id:3,
						title:'ETH',
					}
				]
			};
		},
		computed: {
			i18n() {
				return this.$t('component');
			},
			model() {
				return this.$store.state.config.model;
			}
		},
		methods:{
			open(){
				this.$refs.popup.open('bottom');
			},
			confirm(e){
				this.$emit('confirm',e);
				this.closePopup();
			},
			closePopup() {
				this.$refs.popup.close();
			},
		}
	}
</script>

<style scoped lang="scss">
	.popupWrap {
		background: #0E0F11;
		// color: #F7F7F7;
		.titleWrap {
			margin-bottom: 6rpx;
			font-size: 32rpx;
			color: #F7F7F7;
			image {
				width: 36rpx;
				height: 36rpx;
			}
		}
		.list {
			border-bottom: 2rpx solid #1F2128;
			font-size: 0rpx;
		}
		.listLight {
			border-bottom: 2rpx solid #F4F4F4;
		}
	}
	.popupWrapLight {
		background: #ffffff;
		
		.titleWrap {
			color: #0E0F11;
		}
	}
</style>